package com.atguigu.gmall.cart.client.feign;

import com.atguigu.gmall.cart.client.feign.fallback.CartFeignClientFallBack;
import com.atguigu.gmall.model.cart.CartInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author wk
 * @create 2021-09-07 21:31
 * 购物车对外暴露接口
 */
@Service
@FeignClient(value = "service-cart", fallback = CartFeignClientFallBack.class)
public interface CartFeignClient {
    @PostMapping("/api/cart/addCart/{skuId}/{skuNum}")
    void addCart(@PathVariable Long skuId, @PathVariable Integer skuNum);

    @GetMapping("/api/cart/findCartInfo/{skuId}")
    CartInfo findCartInfo(@PathVariable Long skuId);
    // 查询商品清单信息即 从缓存中查询被选中的商品信息
    @GetMapping("/api/cart/findCartInfoListByIsChecked")
    List<CartInfo> findCartInfoListByIsChecked();
}
